package offer;

import java.util.Arrays;
import java.util.Comparator;

public class offer_0045 {
    public String minNumber(int[] nums) {
        int len=nums.length;
        String[] list=new String[len];
        for(int i=0;i<len;++i){
            list[i]=""+nums[i];
        }
        Arrays.sort(list, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return (o1+o2).compareTo(o2+o1);
            }
        });
        String s="";
        for(int i=0;i<len;++i){
            s+=list[i];
        }
        return s;
    }
}
